package com.crazyauntzhang.easyshopbackend.dao;

import com.crazyauntzhang.easyshopbackend.domain.Supplier;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

@Mapper
@Repository
public interface SupplierDao {

	Supplier selectSupplierById(@Param("supplierID") String supplierID);

	List<Supplier> selectSuppliersById(@Param("supplierID") String supplierID);

	List<Supplier> selectSupplierByName(@Param("supplierName") String supplierName);

	void insertSupplier(@Param("supplierID") String supplierID,
						@Param("supplierName") String supplierName,
						@Param("address") String address,
						@Param("tel") String tel);

	Supplier selectMainSupplier(@Param("itemBarcode") String itemBarcode);

	List<Supplier> selectAllSuppliers();

	void updateSupplier(@Param("supplierID") String supplierID,
						@Param("newSupplierID") String newSupplierID,
						@Param("supplierName") String supplierName,
						@Param("address") String address,
						@Param("tel") String tel);

	void deleteSupplier(@Param("supplierID") String supplierID);

}
